
//加入购物车
function delectOneProductAllPointtt(el) {
    event.stopPropagation();
    var gid = $(el).attr('g_id');
    car(gid,2);
}
function addOneProductAllPointtt(el) {
    event.stopPropagation();
    var gid = $(el).attr('g_id');
    car(gid,1);
}
function car(gid,type) {
    $.ajax({
        url: "/home/Index/putGoodInCar",
        data: 'g_id=' + gid + '&type=' + type,//
        type: 'POST',
        dataType: 'JSON',
        success: function (data) {
            if (data.status == 200) {
                var num = $('#numberrr_'+gid).text();
                if(type == 1){
                    $('#numberrr_'+gid).text(num-0+1)
                }else{
                    $('#numberrr_'+gid).text(num-1)
                }
            } else if(data.status == 4){
                location.href = "/home/Login/gologin";
            }else{
                alert(data.msg)
            }
        },
        error: function () {
            alert('Ajax error!');
        }
    })
}
